<template>
  <div class="declaration-wrapper">
    <div class="declara">
      <van-notice-bar :text="declara">
        <div slot="left-icon">
          <van-icon name="edit" class="icon" @click="a" />
        </div>
      </van-notice-bar>
    </div>
    <div class="qiandao ctmd">签到</div>
  </div>
</template>

<script>
import { mapActions } from 'vuex'
export default {
  data() {
    return {
      declara: ''
    }
  },
  mounted() {
    this.declaration().then((res) => {
      if (res.data.ok === 1) {
        this.declara = res.data.data.text
      }
    })
  },
  methods: {
    a() {
      console.log(1)
    },
    ...mapActions(['declaration'])
  }
}
</script>

<style lang="scss" scoped>
.declaration-wrapper {
  width: 100%;
  height: 40px;
  display: flex;
  justify-content: space-between;
  .declara {
    flex: 1;
  }
  .qiandao {
    flex: 0 0 15%;
    background-color: $tmBgcolor;
    color: #333;
  }

  .icon {
    margin-right: 10px;
  }
}
</style>
